package com.atguigu.gulimall.product.web;

import com.atguigu.common.utils.R;
import com.atguigu.gulimall.product.service.SkuInfoService;
import com.atguigu.gulimall.product.vo.Cart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.concurrent.ExecutionException;

@Controller
public class CartController {

    @Autowired
    private SkuInfoService skuInfoService;

    @GetMapping("/cart")
    @ResponseBody
    public Cart cart() throws ExecutionException, InterruptedException {
        Cart cart = skuInfoService.cart();
        return cart;
    }
}
